<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Use of debug descriptions in &mu;Vision</title>
<title>CMSIS-Pack: Use of debug descriptions in &mu;Vision</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="cmsis.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="printComponentTabs.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 46px;">
  <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">CMSIS-Pack
   &#160;<span id="projectnumber">Version 1.6.3</span>
   </div>
   <div id="projectbrief">Delivery Mechanism for Software Packs</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<div id="CMSISnav" class="tabs1">
    <ul class="tablist">
      <script type="text/javascript">
		<!--
		writeComponentTabs.call(this);
		//-->
      </script>
	  </ul>
</div>
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('dbg_sqns_uvision.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Use of debug descriptions in &mu;Vision </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="el" href="debug_description.html">Debug Description</a> elements and access sequences are defined as IDE-independent. However the debug IDE can use this information to provide settings and to use sequences where applicable in its debug flow.</p>
<p><a href="http://www2.keil.com/mdk5/debug" target="__blank"><b>Arm &mu;Vision debugger </b></a> (part of <a href="http://www2.keil.com/mdk5" target="__blank">Keil MDK</a>) supports CMSIS debug descriptions. If any of the <a class="el" href="debug_description.html#das_elements">debug description elements</a> or <a class="el" href="debug_description.html#pdsc_SequenceNameEnum_pg">debug access sequences</a> are defined in a DFP for the target MCU the &mu;Vision automatically detects that and provides user with the configuration options described in this chapter.</p>
<h1><a class="anchor" id="dbg_sqns_uVision_enable"></a>
Enabling debug descriptions</h1>
<p>By default &mu;Vision enables the use of the debug descriptions if such are specified for the target. It is possible to manually disable the use of the debug descriptions for a specific project target in <b>Options for Target...</b> dialog - <b>Debug</b> tab - <b>Settings</b> button - <b>Pack</b> tab. If the item "Enable" is unchecked the debugger will ignore all device descriptions specified in the DFP:</p>
<div class="image">
<img src="dbg_uVision_sqns_enable.png" alt="dbg_uVision_sqns_enable.png"/>
</div>
<p>When the use of debug descriptions is enabled various debugger configuration options can becomed locked as specified in the DFP. Section <a class="el" href="dbg_sqns_uvision.html#dbg_sqns_uvision_config">Impact of debug access configuration</a> explains the debugger parameters that can be configured with the debug descriptions.</p>
<p>Disabling the use of debug descriptions can be useful to verify the default debugger behavior on the device.</p>
<h1><a class="anchor" id="dbg_sqns_uvision_config"></a>
Impact of debug access configuration</h1>
<h2><a class="anchor" id="dbg_sqns_uvision_dbg_setting_debug"></a>
Debug connection</h2>
<p>When <a class="el" href="dbg_setup_access.html#dbg_debug_settings">Default debugger configuration</a> are provided the &mu;Vision debugger automatically applies these settings to the new project for the MCU. This can be observed in <b> Options for Target...</b> dialog - <b>Debug</b> tab - <b>Settings</b> button.</p>
<p>Below is an example of the configuration code and how it is applied by &mu;Vision.</p>
<div class="fragment"><div class="line">&lt;devices&gt;</div>
<div class="line">  &lt;family Dfamily=<span class="stringliteral">&quot;LPC54000 Series&quot;</span> Dvendor=<span class="stringliteral">&quot;NXP:11&quot;</span>&gt;</div>
<div class="line">    &lt;debugconfig <span class="keywordflow">default</span>=<span class="stringliteral">&quot;swd&quot;</span> clock=<span class="stringliteral">&quot;5000000&quot;</span> swj=<span class="stringliteral">&quot;true&quot;</span>/&gt;</div>
<div class="line">    ...</div>
<div class="line">  &lt;/family&gt;</div>
<div class="line">&lt;/devices&gt;</div>
</div><!-- fragment --><div class="image">
<img src="dbg_uVision_debugconfig.png" alt="dbg_uVision_debugconfig.png"/>
</div>
<p>SWD is selected as the default debug protocol with 5MHz clock and SWJ checkbox locked because this is a fixed characteristic of the device.</p>
<h2><a class="anchor" id="dbg_sqns_uvision_dbg_setting_ap"></a>
Access port</h2>
<p>With the <a class="el" href="dbg_setup_access.html#dbg_debug">specificaton of the debug connection</a> &mu;Vision debugger will automatically use the access port specified via the <b>__ap</b> attribute when debugging the processor and there's no need for user to configure it in the IDE. Corresponding option is locked as shown on the figure below.</p>
<div class="image">
<img src="uVision_AP_locked.png" alt="uVision_AP_locked.png"/>
</div>
<p>&mu;Vision debugger displays the JTAG ID Code and the IR Length values (actually read or overwritten ones) in debug settings:</p>
<div class="image">
<img src="dbg_uVision_jtag_chain.png" alt="dbg_uVision_jtag_chain.png"/>
</div>
<p>You can test what the &mu;Vision debugger is able to detect automatically without the <b>debugport</b> configuration in the pdsc. For that the use of debug description shall be disabled in the <b>Pack</b> tab.</p>
<h2><a class="anchor" id="dbg_sqns_uvision_dbg_setting_reset"></a>
Reset types and default selection</h2>
<p>The default reset type can be specified in <a class="el" href="pdsc_family_pg.html#element_debug">debug</a> element via <a class="el" href="pdsc_family_pg.html#defaultResetSequence">defaultResetSequence</a> attribute.</p>
<p>It is also possible to disable particular reset type for selection by overwriting corresponding predefined reset sequence with <b>disable</b> attribute set to 'true'. For example reset configuration implemented for Microchip SAML11 device:</p>
<div class="fragment"><div class="line"> &lt;debug defaultResetSequence=<span class="stringliteral">&quot;ResetSystem&quot;</span>/&gt;</div>
<div class="line">...</div>
<div class="line"></div>
<div class="line"> &lt;!-- VECTRESET - Disabled --&gt;</div>
<div class="line"> &lt;sequence name=<span class="stringliteral">&quot;ResetProcessor&quot;</span> disable=<span class="stringliteral">&quot;true&quot;</span> info=<span class="stringliteral">&quot;VECTRESET&quot;</span>&gt;</div>
<div class="line">        &lt;!-- ResetProcessor not available <span class="keywordflow">for</span> CM23 --&gt;</div>
<div class="line"> &lt;/sequence&gt;</div>
</div><!-- fragment --><p>&mu;Vision debugger applies it automatically and displays as default and selected in <b>Options for Target...</b> dialog - <b>Debug</b> tab - <b>Settings</b> button and then <b>Reset:</b> </p>
<div class="image">
<img src="dbg_uVision_reset_configs.png" alt="dbg_uVision_reset_configs.png"/>
</div>
<p>You can see the VECTRESET type is absent and system reset is selected and marked as default. The user can still manually change the reset type for the project in this dialog.</p>
<p>Using the <b>Reset</b> dropdown menu mentioned above a user can specify the reset type to be performed by the debugger.</p>
<p>Figure below shows how the typically available reset options map to the corresponding reset types in the connect flow described in <a class="el" href="debug_description.html#usage_of_sequences">Usage of debug access sequences</a>. Note that "Custom" reset type appears only when user-defined debug sequence is assigned to the <a class="el" href="pdsc_family_pg.html#defaultResetSequence">defaultResetSequence</a> attribute.</p>
<div class="image">
<img src="dbg_uVision_reset_options.png" alt="dbg_uVision_reset_options.png"/>
</div>
<p>Detailed meanings for available options are explained in the documentation of corresponding debug adapter. For example for ULINKpro <a href="https://www.keil.com/support/man/docs/ulinkpro/ulinkpro_ctx_debug.htm#/connect" target="__blank"><b>Connect &amp; Reset Options</b></a></p>
<h1><a class="anchor" id="dbg_uVision_dbgconf"></a>
Debug configuration file (*.dbgconf)</h1>
<p>If the .pdsc file specifies for the target <a class="el" href="pdsc_family_pg.html#element_debugvars">debugvars</a> with the <code>configfile</code> attribute then &mu;Vision automatically creates an instance of debug configuration file for each target in the project by copying the *.dbgconf from the specified location in the pack to the <code>DebugConfig</code> directory in the application project.</p>
<div class="image">
<img src="dbg_uVision_dbgconf.png" alt="dbg_uVision_dbgconf.png"/>
</div>
<p>Clicking "Edit" button will open the debug configuration file in &mu;Vision for editing. If the .dbgconf file is written with the <a class="el" href="configWizard.html">Configuration Wizard annotations</a> the graphical view is available in &mu;Vision providing users with the intuitive configuration interface. For example:</p>
<div class="image">
<img src="dbg_uVision_dbgconf_wizard.png" alt="dbg_uVision_dbgconf_wizard.png"/>
</div>
<h1><a class="anchor" id="dbg_uVision_sqns_logging"></a>
Logging debug sequences</h1>
<p>&mu;Vision can save information about executed debug sequences into a log file. This can be useful when implementing debug sequences or analyzing debugger behavior.</p>
<p>The logging can be enabled via <b>Options for Target...</b> dialog - <b>Debug</b> tab - <b>Settings</b> button - <b>Pack</b> tab as shown on the figure below. The path and file name cannot be modified.</p>
<div class="image">
<img src="dbg_uVision_sqns_log.png" alt="dbg_uVision_sqns_log.png"/>
</div>
<p>Note that the log file stores only debug sequences specified in the .pdsc file. The non-overwritten <a class="el" href="debug_description.html#default_sequences">predefined debug sequences</a> do not appear in the log but still get executed by the debugger.</p>
<h2><a class="anchor" id="dbg_uVision_debug_access_log"></a>
Debug access log</h2>
<p>Detailed information about the debugger operation can be obtained in the debug access log.</p>
<p>It can be enabled in <b>Options for Target...</b> dialog - <b>Debug</b> tab - <b>Settings</b> button as shown on figure below. The file is stored in the project root folder as <code> &lt;DebugAdapter&gt;_DebugLog_&lt;sequenceNr&gt;.log</code> file. For example: <code>ULINKplus_DebugLog_0000.log</code>.</p>
<div class="image">
<img src="dbg_uVision_debug_access_log.png" alt="dbg_uVision_debug_access_log.png"/>
</div>
<h1><a class="anchor" id="dbg_uVision_reset"></a>
Debug connect &amp; reset configuration</h1>
<p>&mu;Vision debugger provides options to enable and configure debug connect and reset operations. Based on these settings decisions in the debug flow are made as shown in <a class="el" href="debug_description.html#usage_of_sequences">Usage of debug access sequences</a>. Available configuration options depend on the debug adapters, but the approach is similar in most cases. Examples below explain the options available for ULINK and CMSIS-DAP adapters.</p>
<p>Use <b>Options for Target...</b> dialog - <b>Debug</b> tab - <b>Settings</b> button and then in <b>Connect:</b> dropdown menu select the option for debugger operation when establishing connection to the target.</p>
<p>Figure below shows how the options "with Pre-reset" and "under Reset" map to the corresponding operations in the connect flow described in <a class="el" href="debug_description.html#usage_of_sequences">Usage of debug access sequences</a>.</p>
<div class="image">
<img src="dbg_uVision_connect_options.png" alt="dbg_uVision_connect_options.png"/>
</div>
<p>Detailed explanation for available options are can be found in the documentation of corresponding debug adapter. For example for ULINKpro <a href="https://www.keil.com/support/man/docs/ulinkpro/ulinkpro_ctx_debug.htm#/connect" target="__blank"><b>Connect &amp; Reset Options</b></a></p>
<p><a class="el" href="dbg_sqns_uvision.html#dbg_sqns_uvision_dbg_setting_reset">Reset types and default selection</a> explains the <b>Reset</b> dropdown menu in the same area and its mapping to the reset types used in <a class="el" href="debug_description.html#usage_of_sequences">Usage of debug access sequences</a>.</p>
<h1><a class="anchor" id="dbg_sqns_uVision_flash"></a>
Enable flash sequences</h1>
<p>The option is currently in experimental status. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="coresight_setup.html">Debug Setup with CMSIS-Pack</a></li><li class="navelem"><a class="el" href="dbg_setup_tutorial.html">Debug Setup Tutorial</a></li><li class="navelem"><a class="el" href="dbg_sqns_ide.html">Use of debug descriptions in IDEs</a></li>
    <li class="footer">Generated on Thu Apr 9 2020 16:06:03 for CMSIS-Pack Version 1.6.3 by Arm Ltd. All rights reserved.
	<!--
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 
	-->
	</li>
  </ul>
</div>
</body>
</html>
